#define _CRT_SECURE_NO_WARNINGS 1
#include <math.h>
#include <stdio.h>
int fun(unsigned int x)
{
    int n = 0;
    while (x + 1)
    {
        n++;
        x = x | (x + 1);
    } 
    return n;
}
int main() {
    int n;
    scanf("%d", &n);
    int ret=fun(n);
    printf("%d", ret);
    return 0;
}